<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-

This module contains helper functions for reporting and creating
unbound variables.

-}</span><span>
</span><span id="line-7"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Rename.Unbound</span><span>
</span><span id="line-8"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#mkUnboundName"><span class="hs-identifier">mkUnboundName</span></a></span><span>
</span><span id="line-9"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#mkUnboundNameRdr"><span class="hs-identifier">mkUnboundNameRdr</span></a></span><span>
</span><span id="line-10"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier">isUnboundName</span></a></span><span>
</span><span id="line-11"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#reportUnboundName"><span class="hs-identifier">reportUnboundName</span></a></span><span>
</span><span id="line-12"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#unknownNameSuggestions"><span class="hs-identifier">unknownNameSuggestions</span></a></span><span>
</span><span id="line-13"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier">WhereLooking</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#unboundName"><span class="hs-identifier">unboundName</span></a></span><span>
</span><span id="line-15"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#unboundNameX"><span class="hs-identifier">unboundNameX</span></a></span><span>
</span><span id="line-16"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#notInScopeErr"><span class="hs-identifier">notInScopeErr</span></a></span><span>
</span><span id="line-17"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#exactNameErr"><span class="hs-identifier">exactNameErr</span></a></span><span>
</span><span id="line-18"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span class="hs-keyword">where</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">SrcLoc</span></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Outputable</span></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#mkUnboundName"><span class="hs-identifier">mkUnboundName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier">isUnboundName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier">getUnique</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#on"><span class="hs-identifier">on</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.DFM.html"><span class="hs-identifier">GHC.Types.Unique.DFM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier">udfmToList</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
               What to do when a lookup fails
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-keyword">data</span><span> </span><span id="WhereLooking"><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-var">WhereLooking</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="WL_Any"><span class="annot"><a href="GHC.Rename.Unbound.html#WL_Any"><span class="hs-identifier hs-var">WL_Any</span></a></span></span><span>        </span><span class="hs-comment">-- Any binding</span><span>
</span><span id="line-48"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span id="WL_Global"><span class="annot"><a href="GHC.Rename.Unbound.html#WL_Global"><span class="hs-identifier hs-var">WL_Global</span></a></span></span><span>     </span><span class="hs-comment">-- Any top-level binding (local or imported)</span><span>
</span><span id="line-49"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span id="WL_LocalTop"><span class="annot"><a href="GHC.Rename.Unbound.html#WL_LocalTop"><span class="hs-identifier hs-var">WL_LocalTop</span></a></span></span><span>   </span><span class="hs-comment">-- Any top-level binding in this module</span><span>
</span><span id="line-50"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span id="WL_LocalOnly"><span class="annot"><a href="GHC.Rename.Unbound.html#WL_LocalOnly"><span class="hs-identifier hs-var">WL_LocalOnly</span></a></span></span><span>
</span><span id="line-51"></span><span>                        </span><span class="hs-comment">-- Only local bindings</span><span>
</span><span id="line-52"></span><span>                        </span><span class="hs-comment">-- (pattern synonyms declaractions,</span><span>
</span><span id="line-53"></span><span>                        </span><span class="hs-comment">-- see Note [Renaming pattern synonym variables])</span><span>
</span><span id="line-54"></span><span>
</span><span id="line-55"></span><span class="annot"><a href="GHC.Rename.Unbound.html#mkUnboundNameRdr"><span class="hs-identifier hs-type">mkUnboundNameRdr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-56"></span><span id="mkUnboundNameRdr"><span class="annot"><span class="annottext">mkUnboundNameRdr :: RdrName -&gt; Name
</span><a href="GHC.Rename.Unbound.html#mkUnboundNameRdr"><span class="hs-identifier hs-var hs-var">mkUnboundNameRdr</span></a></span></span><span> </span><span id="local-6989586621681109443"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109443"><span class="hs-identifier hs-var">rdr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Name
</span><a href="GHC.Builtin.Names.html#mkUnboundName"><span class="hs-identifier hs-var">mkUnboundName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109443"><span class="hs-identifier hs-var">rdr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="annot"><a href="GHC.Rename.Unbound.html#reportUnboundName"><span class="hs-identifier hs-type">reportUnboundName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-59"></span><span id="reportUnboundName"><span class="annot"><span class="annottext">reportUnboundName :: RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Unbound.html#reportUnboundName"><span class="hs-identifier hs-var hs-var">reportUnboundName</span></a></span></span><span> </span><span id="local-6989586621681109441"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109441"><span class="hs-identifier hs-var">rdr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WhereLooking -&gt; RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Unbound.html#unboundName"><span class="hs-identifier hs-var">unboundName</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_Any"><span class="hs-identifier hs-var">WL_Any</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109441"><span class="hs-identifier hs-var">rdr</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="annot"><a href="GHC.Rename.Unbound.html#unboundName"><span class="hs-identifier hs-type">unboundName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-type">WhereLooking</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-62"></span><span id="unboundName"><span class="annot"><span class="annottext">unboundName :: WhereLooking -&gt; RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Unbound.html#unboundName"><span class="hs-identifier hs-var hs-var">unboundName</span></a></span></span><span> </span><span id="local-6989586621681109440"><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109440"><span class="hs-identifier hs-var">wl</span></a></span></span><span> </span><span id="local-6989586621681109439"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109439"><span class="hs-identifier hs-var">rdr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WhereLooking -&gt; RdrName -&gt; SDoc -&gt; RnM Name
</span><a href="GHC.Rename.Unbound.html#unboundNameX"><span class="hs-identifier hs-var">unboundNameX</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109440"><span class="hs-identifier hs-var">wl</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109439"><span class="hs-identifier hs-var">rdr</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="annot"><a href="GHC.Rename.Unbound.html#unboundNameX"><span class="hs-identifier hs-type">unboundNameX</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-type">WhereLooking</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span>
</span><span id="line-65"></span><span id="unboundNameX"><span class="annot"><span class="annottext">unboundNameX :: WhereLooking -&gt; RdrName -&gt; SDoc -&gt; RnM Name
</span><a href="GHC.Rename.Unbound.html#unboundNameX"><span class="hs-identifier hs-var hs-var">unboundNameX</span></a></span></span><span> </span><span id="local-6989586621681109437"><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109437"><span class="hs-identifier hs-var">where_look</span></a></span></span><span> </span><span id="local-6989586621681109436"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109436"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span> </span><span id="local-6989586621681109435"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109435"><span class="hs-identifier hs-var">extra</span></a></span></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681109434"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109434"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-67"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109432"><span class="annot"><span class="annottext">show_helpful_errors :: Bool
</span><a href="#local-6989586621681109432"><span class="hs-identifier hs-var hs-var">show_helpful_errors</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_HelpfulErrors"><span class="hs-identifier hs-var">Opt_HelpfulErrors</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109434"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-68"></span><span>              </span><span id="local-6989586621681109429"><span class="annot"><span class="annottext">err :: SDoc
</span><a href="#local-6989586621681109429"><span class="hs-identifier hs-var hs-var">err</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#notInScopeErr"><span class="hs-identifier hs-var">notInScopeErr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109436"><span class="hs-identifier hs-var">rdr_name</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109435"><span class="hs-identifier hs-var">extra</span></a></span><span>
</span><span id="line-69"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109432"><span class="hs-identifier hs-var">show_helpful_errors</span></a></span><span>
</span><span id="line-70"></span><span>          </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109429"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-71"></span><span>          </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681109425"><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109425"><span class="hs-identifier hs-var">local_env</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RnM LocalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getLocalRdrEnv"><span class="hs-identifier hs-var">getLocalRdrEnv</span></a></span><span>
</span><span id="line-72"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681109423"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109423"><span class="hs-identifier hs-var">global_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn GlobalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getGlobalRdrEnv"><span class="hs-identifier hs-var">getGlobalRdrEnv</span></a></span><span>
</span><span id="line-73"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681109421"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681109421"><span class="hs-identifier hs-var">impInfo</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn ImportAvails
</span><a href="GHC.Tc.Utils.Monad.html#getImports"><span class="hs-identifier hs-var">getImports</span></a></span><span>
</span><span id="line-74"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681109419"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109419"><span class="hs-identifier hs-var">currmod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-75"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681109417"><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681109417"><span class="hs-identifier hs-var">hpt</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv HomePackageTable
forall gbl lcl. TcRnIf gbl lcl HomePackageTable
</span><a href="GHC.Tc.Utils.Monad.html#getHpt"><span class="hs-identifier hs-var">getHpt</span></a></span><span>
</span><span id="line-76"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109415"><span class="annot"><span class="annottext">suggestions :: SDoc
</span><a href="#local-6989586621681109415"><span class="hs-identifier hs-var hs-var">suggestions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WhereLooking
-&gt; DynFlags
-&gt; HomePackageTable
-&gt; Module
-&gt; GlobalRdrEnv
-&gt; LocalRdrEnv
-&gt; ImportAvails
-&gt; RdrName
-&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#unknownNameSuggestions_"><span class="hs-identifier hs-var">unknownNameSuggestions_</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109437"><span class="hs-identifier hs-var">where_look</span></a></span><span>
</span><span id="line-77"></span><span>                          </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109434"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681109417"><span class="hs-identifier hs-var">hpt</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109419"><span class="hs-identifier hs-var">currmod</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109423"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109425"><span class="hs-identifier hs-var">local_env</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681109421"><span class="hs-identifier hs-var">impInfo</span></a></span><span>
</span><span id="line-78"></span><span>                          </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109436"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-79"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; TcRn ()
</span><a href="GHC.Tc.Utils.Monad.html#addErr"><span class="hs-identifier hs-var">addErr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109429"><span class="hs-identifier hs-var">err</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109415"><span class="hs-identifier hs-var">suggestions</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-80"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; RnM Name
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; Name
</span><a href="GHC.Rename.Unbound.html#mkUnboundNameRdr"><span class="hs-identifier hs-var">mkUnboundNameRdr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109436"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span class="annot"><a href="GHC.Rename.Unbound.html#notInScopeErr"><span class="hs-identifier hs-type">notInScopeErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-83"></span><span id="notInScopeErr"><span class="annot"><span class="annottext">notInScopeErr :: RdrName -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#notInScopeErr"><span class="hs-identifier hs-var hs-var">notInScopeErr</span></a></span></span><span> </span><span id="local-6989586621681109413"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109413"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span>
</span><span id="line-84"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; Maybe Name
</span><a href="GHC.Types.Name.Reader.html#isExact_maybe"><span class="hs-identifier hs-var">isExact_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109413"><span class="hs-identifier hs-var">rdr_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-85"></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681109411"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109411"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#exactNameErr"><span class="hs-identifier hs-var">exactNameErr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109411"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-86"></span><span>      </span><span class="annot"><span class="annottext">Maybe Name
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Not in scope:&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span>                  </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109408"><span class="hs-identifier hs-var">what</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109413"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-89"></span><span>    </span><span id="local-6989586621681109408"><span class="annot"><span class="annottext">what :: SDoc
</span><a href="#local-6989586621681109408"><span class="hs-identifier hs-var hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; SDoc
</span><a href="GHC.Types.Name.Occurrence.html#pprNonVarNameSpace"><span class="hs-identifier hs-var">pprNonVarNameSpace</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#occNameSpace"><span class="hs-identifier hs-var hs-var">occNameSpace</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109413"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>
</span><span id="line-91"></span><span class="hs-keyword">type</span><span> </span><span id="HowInScope"><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-var">HowInScope</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#ImpDeclSpec"><span class="hs-identifier hs-type">ImpDeclSpec</span></a></span><span>
</span><span id="line-92"></span><span>     </span><span class="hs-comment">-- Left loc    =&gt;  locally bound at loc</span><span>
</span><span id="line-93"></span><span>     </span><span class="hs-comment">-- Right ispec =&gt;  imported as specified by ispec</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>
</span><span id="line-96"></span><span class="hs-comment">-- | Called from the typechecker (&quot;GHC.Tc.Errors&quot;) when we find an unbound variable</span><span>
</span><span id="line-97"></span><span class="annot"><a href="GHC.Rename.Unbound.html#unknownNameSuggestions"><span class="hs-identifier hs-type">unknownNameSuggestions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-98"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HomePackageTable"><span class="hs-identifier hs-type">HomePackageTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-99"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#LocalRdrEnv"><span class="hs-identifier hs-type">LocalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ImportAvails"><span class="hs-identifier hs-type">ImportAvails</span></a></span><span>
</span><span id="line-100"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-101"></span><span id="unknownNameSuggestions"><span class="annot"><span class="annottext">unknownNameSuggestions :: DynFlags
-&gt; HomePackageTable
-&gt; Module
-&gt; GlobalRdrEnv
-&gt; LocalRdrEnv
-&gt; ImportAvails
-&gt; RdrName
-&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#unknownNameSuggestions"><span class="hs-identifier hs-var hs-var">unknownNameSuggestions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">WhereLooking
-&gt; DynFlags
-&gt; HomePackageTable
-&gt; Module
-&gt; GlobalRdrEnv
-&gt; LocalRdrEnv
-&gt; ImportAvails
-&gt; RdrName
-&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#unknownNameSuggestions_"><span class="hs-identifier hs-var">unknownNameSuggestions_</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_Any"><span class="hs-identifier hs-var">WL_Any</span></a></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="annot"><a href="GHC.Rename.Unbound.html#unknownNameSuggestions_"><span class="hs-identifier hs-type">unknownNameSuggestions_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-type">WhereLooking</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-104"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HomePackageTable"><span class="hs-identifier hs-type">HomePackageTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-105"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#LocalRdrEnv"><span class="hs-identifier hs-type">LocalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ImportAvails"><span class="hs-identifier hs-type">ImportAvails</span></a></span><span>
</span><span id="line-106"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-107"></span><span id="unknownNameSuggestions_"><span class="annot"><span class="annottext">unknownNameSuggestions_ :: WhereLooking
-&gt; DynFlags
-&gt; HomePackageTable
-&gt; Module
-&gt; GlobalRdrEnv
-&gt; LocalRdrEnv
-&gt; ImportAvails
-&gt; RdrName
-&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#unknownNameSuggestions_"><span class="hs-identifier hs-var hs-var">unknownNameSuggestions_</span></a></span></span><span> </span><span id="local-6989586621681109402"><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109402"><span class="hs-identifier hs-var">where_look</span></a></span></span><span> </span><span id="local-6989586621681109401"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109401"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681109400"><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681109400"><span class="hs-identifier hs-var">hpt</span></a></span></span><span> </span><span id="local-6989586621681109399"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109399"><span class="hs-identifier hs-var">curr_mod</span></a></span></span><span> </span><span id="local-6989586621681109398"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109398"><span class="hs-identifier hs-var">global_env</span></a></span></span><span> </span><span id="local-6989586621681109397"><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109397"><span class="hs-identifier hs-var">local_env</span></a></span></span><span>
</span><span id="line-108"></span><span>                          </span><span id="local-6989586621681109396"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681109396"><span class="hs-identifier hs-var">imports</span></a></span></span><span> </span><span id="local-6989586621681109395"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109395"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-109"></span><span>    </span><span class="annot"><span class="annottext">WhereLooking
-&gt; DynFlags -&gt; GlobalRdrEnv -&gt; LocalRdrEnv -&gt; RdrName -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#similarNameSuggestions"><span class="hs-identifier hs-var">similarNameSuggestions</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109402"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109401"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109398"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109397"><span class="hs-identifier hs-var">local_env</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109395"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-110"></span><span>    </span><span class="annot"><span class="annottext">WhereLooking
-&gt; GlobalRdrEnv
-&gt; HomePackageTable
-&gt; Module
-&gt; ImportAvails
-&gt; RdrName
-&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#importSuggestions"><span class="hs-identifier hs-var">importSuggestions</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109402"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109398"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681109400"><span class="hs-identifier hs-var">hpt</span></a></span><span>
</span><span id="line-111"></span><span>                      </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109399"><span class="hs-identifier hs-var">curr_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681109396"><span class="hs-identifier hs-var">imports</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109395"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-112"></span><span>    </span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#extensionSuggestions"><span class="hs-identifier hs-var">extensionSuggestions</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109395"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span><span>
</span><span id="line-113"></span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="annot"><a href="GHC.Rename.Unbound.html#similarNameSuggestions"><span class="hs-identifier hs-type">similarNameSuggestions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-type">WhereLooking</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-116"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#LocalRdrEnv"><span class="hs-identifier hs-type">LocalRdrEnv</span></a></span><span>
</span><span id="line-117"></span><span>                        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-118"></span><span id="similarNameSuggestions"><span class="annot"><span class="annottext">similarNameSuggestions :: WhereLooking
-&gt; DynFlags -&gt; GlobalRdrEnv -&gt; LocalRdrEnv -&gt; RdrName -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#similarNameSuggestions"><span class="hs-identifier hs-var hs-var">similarNameSuggestions</span></a></span></span><span> </span><span id="local-6989586621681109391"><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109391"><span class="hs-identifier hs-var">where_look</span></a></span></span><span> </span><span id="local-6989586621681109390"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109390"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681109389"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109389"><span class="hs-identifier hs-var">global_env</span></a></span></span><span>
</span><span id="line-119"></span><span>                        </span><span id="local-6989586621681109388"><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109388"><span class="hs-identifier hs-var">local_env</span></a></span></span><span> </span><span id="local-6989586621681109387"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109387"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span></span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[(RdrName, HowInScope)]
</span><a href="#local-6989586621681109386"><span class="hs-identifier hs-var">suggest</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-121"></span><span>      </span><span class="hs-special">[</span><span class="hs-special">]</span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-122"></span><span>      </span><span class="hs-special">[</span><span id="local-6989586621681109385"><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109385"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109384"><span class="hs-identifier hs-var">perhaps</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName, HowInScope) -&gt; SDoc
</span><a href="#local-6989586621681109383"><span class="hs-identifier hs-var">pp_item</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109385"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-123"></span><span>      </span><span id="local-6989586621681109382"><span class="annot"><span class="annottext">[(RdrName, HowInScope)]
</span><a href="#local-6989586621681109382"><span class="hs-identifier hs-var">ps</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109384"><span class="hs-identifier hs-var">perhaps</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;one of these:&quot;</span></span><span>
</span><span id="line-124"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((RdrName, HowInScope) -&gt; SDoc) -&gt; [(RdrName, HowInScope)] -&gt; SDoc
forall a. (a -&gt; SDoc) -&gt; [a] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#pprWithCommas"><span class="hs-identifier hs-var">pprWithCommas</span></a></span><span> </span><span class="annot"><span class="annottext">(RdrName, HowInScope) -&gt; SDoc
</span><a href="#local-6989586621681109383"><span class="hs-identifier hs-var">pp_item</span></a></span><span> </span><span class="annot"><span class="annottext">[(RdrName, HowInScope)]
</span><a href="#local-6989586621681109382"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-125"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-126"></span><span>    </span><span class="annot"><a href="#local-6989586621681109378"><span class="hs-identifier hs-type">all_possibilities</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-type">HowInScope</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-127"></span><span>    </span><span id="local-6989586621681109378"><span class="annot"><span class="annottext">all_possibilities :: [(String, (RdrName, HowInScope))]
</span><a href="#local-6989586621681109378"><span class="hs-identifier hs-var hs-var">all_possibilities</span></a></span></span><span>
</span><span id="line-128"></span><span>       </span><span class="hs-glyph">=</span><span>  </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; RdrName -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109390"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109376"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109376"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HowInScope
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681109375"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109376"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109376"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681109375"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681109375"><span class="hs-identifier hs-var">loc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv -&gt; [(RdrName, SrcSpan)]
</span><a href="#local-6989586621681109374"><span class="hs-identifier hs-var">local_possibilities</span></a></span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109388"><span class="hs-identifier hs-var">local_env</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-130"></span><span>       </span><span class="annot"><span class="annottext">[(String, (RdrName, HowInScope))]
-&gt; [(String, (RdrName, HowInScope))]
-&gt; [(String, (RdrName, HowInScope))]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; RdrName -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109390"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109373"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109372"><span class="hs-identifier hs-var">rp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109373"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109373"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109372"><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109372"><span class="hs-identifier hs-var">rp</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [(RdrName, (RdrName, HowInScope))]
</span><a href="#local-6989586621681109371"><span class="hs-identifier hs-var">global_possibilities</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109389"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-131"></span><span>
</span><span id="line-132"></span><span>    </span><span id="local-6989586621681109386"><span class="annot"><span class="annottext">suggest :: [(RdrName, HowInScope)]
</span><a href="#local-6989586621681109386"><span class="hs-identifier hs-var hs-var">suggest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
-&gt; [(String, (RdrName, HowInScope))] -&gt; [(RdrName, HowInScope)]
forall a. String -&gt; [(String, a)] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#fuzzyLookup"><span class="hs-identifier hs-var">fuzzyLookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; RdrName -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681109390"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109387"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(String, (RdrName, HowInScope))]
</span><a href="#local-6989586621681109378"><span class="hs-identifier hs-var">all_possibilities</span></a></span><span>
</span><span id="line-133"></span><span>    </span><span id="local-6989586621681109384"><span class="annot"><span class="annottext">perhaps :: SDoc
</span><a href="#local-6989586621681109384"><span class="hs-identifier hs-var hs-var">perhaps</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you meant&quot;</span></span><span>
</span><span id="line-134"></span><span>
</span><span id="line-135"></span><span>    </span><span class="annot"><a href="#local-6989586621681109383"><span class="hs-identifier hs-type">pp_item</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-type">HowInScope</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-136"></span><span>    </span><span id="local-6989586621681109383"><span class="annot"><span class="annottext">pp_item :: (RdrName, HowInScope) -&gt; SDoc
</span><a href="#local-6989586621681109383"><span class="hs-identifier hs-var hs-var">pp_item</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109368"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109368"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681109367"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681109367"><span class="hs-identifier hs-var">loc</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
</span><a href="#local-6989586621681109366"><span class="hs-identifier hs-var">pp_ns</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109368"><span class="hs-identifier hs-var">rdr</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109368"><span class="hs-identifier hs-var">rdr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681109365"><span class="hs-identifier hs-var">loc'</span></a></span><span> </span><span class="hs-comment">-- Locally defined</span><span>
</span><span id="line-137"></span><span>        </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681109365"><span class="annot"><span class="annottext">loc' :: SDoc
</span><a href="#local-6989586621681109365"><span class="hs-identifier hs-var hs-var">loc'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681109367"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-138"></span><span>                     </span><span class="annot"><a href="GHC.Types.SrcLoc.html#UnhelpfulSpan"><span class="hs-identifier hs-type">UnhelpfulSpan</span></a></span><span> </span><span id="local-6989586621681109361"><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><a href="#local-6989586621681109361"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnhelpfulSpanReason -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">UnhelpfulSpanReason
</span><a href="#local-6989586621681109361"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-139"></span><span>                     </span><span class="annot"><a href="GHC.Types.SrcLoc.html#RealSrcSpan"><span class="hs-identifier hs-type">RealSrcSpan</span></a></span><span> </span><span id="local-6989586621681109358"><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681109358"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe BufSpan
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;line&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RealSrcSpan -&gt; Int
</span><a href="GHC.Types.SrcLoc.html#srcSpanStartLine"><span class="hs-identifier hs-var">srcSpanStartLine</span></a></span><span> </span><span class="annot"><span class="annottext">RealSrcSpan
</span><a href="#local-6989586621681109358"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-140"></span><span>    </span><span class="annot"><a href="#local-6989586621681109383"><span class="hs-identifier hs-var">pp_item</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109355"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109355"><span class="hs-identifier hs-var">rdr</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621681109354"><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109354"><span class="hs-identifier hs-var">is</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
</span><a href="#local-6989586621681109366"><span class="hs-identifier hs-var">pp_ns</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109355"><span class="hs-identifier hs-var">rdr</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109355"><span class="hs-identifier hs-var">rdr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>   </span><span class="hs-comment">-- Imported</span><span>
</span><span id="line-141"></span><span>                              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;imported from&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; ModuleName
</span><a href="GHC.Types.Name.Reader.html#is_mod"><span class="hs-identifier hs-var hs-var">is_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109354"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>
</span><span id="line-143"></span><span>    </span><span class="annot"><a href="#local-6989586621681109366"><span class="hs-identifier hs-type">pp_ns</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-144"></span><span>    </span><span id="local-6989586621681109366"><span class="annot"><span class="annottext">pp_ns :: RdrName -&gt; SDoc
</span><a href="#local-6989586621681109366"><span class="hs-identifier hs-var hs-var">pp_ns</span></a></span></span><span> </span><span id="local-6989586621681109352"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109352"><span class="hs-identifier hs-var">rdr</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681109351"><span class="hs-identifier hs-var">ns</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; NameSpace -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681109349"><span class="hs-identifier hs-var">tried_ns</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; SDoc
</span><a href="GHC.Types.Name.Occurrence.html#pprNameSpace"><span class="hs-identifier hs-var">pprNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681109351"><span class="hs-identifier hs-var">ns</span></a></span><span>
</span><span id="line-145"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-146"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681109351"><span class="annot"><span class="annottext">ns :: NameSpace
</span><a href="#local-6989586621681109351"><span class="hs-identifier hs-var hs-var">ns</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; NameSpace
</span><a href="GHC.Types.Name.Reader.html#rdrNameSpace"><span class="hs-identifier hs-var">rdrNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109352"><span class="hs-identifier hs-var">rdr</span></a></span><span>
</span><span id="line-147"></span><span>
</span><span id="line-148"></span><span>    </span><span id="local-6989586621681109346"><span class="annot"><span class="annottext">tried_occ :: OccName
</span><a href="#local-6989586621681109346"><span class="hs-identifier hs-var hs-var">tried_occ</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; OccName
</span><a href="GHC.Types.Name.Reader.html#rdrNameOcc"><span class="hs-identifier hs-var">rdrNameOcc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109387"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span><span>
</span><span id="line-149"></span><span>    </span><span id="local-6989586621681109345"><span class="annot"><span class="annottext">tried_is_sym :: Bool
</span><a href="#local-6989586621681109345"><span class="hs-identifier hs-var hs-var">tried_is_sym</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#isSymOcc"><span class="hs-identifier hs-var">isSymOcc</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109346"><span class="hs-identifier hs-var">tried_occ</span></a></span><span>
</span><span id="line-150"></span><span>    </span><span id="local-6989586621681109349"><span class="annot"><span class="annottext">tried_ns :: NameSpace
</span><a href="#local-6989586621681109349"><span class="hs-identifier hs-var hs-var">tried_ns</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#occNameSpace"><span class="hs-identifier hs-var hs-var">occNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109346"><span class="hs-identifier hs-var">tried_occ</span></a></span><span>
</span><span id="line-151"></span><span>    </span><span id="local-6989586621681109343"><span class="annot"><span class="annottext">tried_is_qual :: Bool
</span><a href="#local-6989586621681109343"><span class="hs-identifier hs-var hs-var">tried_is_qual</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isQual"><span class="hs-identifier hs-var">isQual</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109387"><span class="hs-identifier hs-var">tried_rdr_name</span></a></span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span>    </span><span id="local-6989586621681109339"><span class="annot"><span class="annottext">correct_name_space :: OccName -&gt; Bool
</span><a href="#local-6989586621681109339"><span class="hs-identifier hs-var hs-var">correct_name_space</span></a></span></span><span> </span><span id="local-6989586621681109338"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109338"><span class="hs-identifier hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">NameSpace -&gt; NameSpace -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#nameSpacesRelated"><span class="hs-identifier hs-var">nameSpacesRelated</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#occNameSpace"><span class="hs-identifier hs-var hs-var">occNameSpace</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109338"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="#local-6989586621681109349"><span class="hs-identifier hs-var">tried_ns</span></a></span><span>
</span><span id="line-154"></span><span>                           </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="GHC.Types.Name.Occurrence.html#isSymOcc"><span class="hs-identifier hs-var">isSymOcc</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109338"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109345"><span class="hs-identifier hs-var">tried_is_sym</span></a></span><span>
</span><span id="line-155"></span><span>        </span><span class="hs-comment">-- Treat operator and non-operators as non-matching</span><span>
</span><span id="line-156"></span><span>        </span><span class="hs-comment">-- This heuristic avoids things like</span><span>
</span><span id="line-157"></span><span>        </span><span class="hs-comment">--      Not in scope 'f'; perhaps you meant '+' (from Prelude)</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span>    </span><span id="local-6989586621681109335"><span class="annot"><span class="annottext">local_ok :: Bool
</span><a href="#local-6989586621681109335"><span class="hs-identifier hs-var hs-var">local_ok</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109391"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_Any"><span class="hs-identifier hs-var">WL_Any</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-160"></span><span>                                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_LocalOnly"><span class="hs-identifier hs-var">WL_LocalOnly</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-161"></span><span>                                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-162"></span><span>    </span><span class="annot"><a href="#local-6989586621681109374"><span class="hs-identifier hs-type">local_possibilities</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#LocalRdrEnv"><span class="hs-identifier hs-type">LocalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-163"></span><span>    </span><span id="local-6989586621681109374"><span class="annot"><span class="annottext">local_possibilities :: LocalRdrEnv -&gt; [(RdrName, SrcSpan)]
</span><a href="#local-6989586621681109374"><span class="hs-identifier hs-var hs-var">local_possibilities</span></a></span></span><span> </span><span id="local-6989586621681109334"><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109334"><span class="hs-identifier hs-var">env</span></a></span></span><span>
</span><span id="line-164"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109343"><span class="hs-identifier hs-var">tried_is_qual</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-165"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109335"><span class="hs-identifier hs-var">local_ok</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-166"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkRdrUnqual"><span class="hs-identifier hs-var">mkRdrUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109332"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109330"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-167"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109330"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109330"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv -&gt; [Name]
</span><a href="GHC.Types.Name.Reader.html#localRdrEnvElts"><span class="hs-identifier hs-var">localRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681109334"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-168"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109332"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681109332"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109330"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-169"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="#local-6989586621681109339"><span class="hs-identifier hs-var">correct_name_space</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109332"><span class="hs-identifier hs-var">occ</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span>    </span><span class="annot"><a href="#local-6989586621681109371"><span class="hs-identifier hs-type">global_possibilities</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-type">HowInScope</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621681109371"><span class="annot"><span class="annottext">global_possibilities :: GlobalRdrEnv -&gt; [(RdrName, (RdrName, HowInScope))]
</span><a href="#local-6989586621681109371"><span class="hs-identifier hs-var hs-var">global_possibilities</span></a></span></span><span> </span><span id="local-6989586621681109327"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109327"><span class="hs-identifier hs-var">global_env</span></a></span></span><span>
</span><span id="line-173"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109343"><span class="hs-identifier hs-var">tried_is_qual</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109326"><span class="hs-identifier hs-var">rdr_qual</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109326"><span class="hs-identifier hs-var">rdr_qual</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HowInScope
</span><a href="#local-6989586621681109325"><span class="hs-identifier hs-var">how</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>                        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109324"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109324"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109327"><span class="hs-identifier hs-var">global_env</span></a></span><span>
</span><span id="line-175"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">WhereLooking -&gt; GlobalRdrElt -&gt; Bool
</span><a href="GHC.Rename.Unbound.html#isGreOk"><span class="hs-identifier hs-var">isGreOk</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109391"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109324"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-176"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109321"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681109321"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109324"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-177"></span><span>                              </span><span id="local-6989586621681109319"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681109319"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109321"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-178"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="#local-6989586621681109339"><span class="hs-identifier hs-var">correct_name_space</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109319"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-179"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109318"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109318"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109325"><span class="annot"><span class="annottext">HowInScope
</span><a href="#local-6989586621681109325"><span class="hs-identifier hs-var">how</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [(ModuleName, HowInScope)]
</span><a href="GHC.Rename.Unbound.html#qualsInScope"><span class="hs-identifier hs-var">qualsInScope</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109324"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-180"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109326"><span class="annot"><span class="annottext">rdr_qual :: RdrName
</span><a href="#local-6989586621681109326"><span class="hs-identifier hs-var hs-var">rdr_qual</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; OccName -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkRdrQual"><span class="hs-identifier hs-var">mkRdrQual</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109318"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109319"><span class="hs-identifier hs-var">occ</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109315"><span class="hs-identifier hs-var">rdr_unqual</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109314"><span class="hs-identifier hs-var">pair</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-183"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109313"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109313"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109327"><span class="hs-identifier hs-var">global_env</span></a></span><span>
</span><span id="line-184"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">WhereLooking -&gt; GlobalRdrElt -&gt; Bool
</span><a href="GHC.Rename.Unbound.html#isGreOk"><span class="hs-identifier hs-var">isGreOk</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109391"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109313"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-185"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109312"><span class="annot"><span class="annottext">name :: Name
</span><a href="#local-6989586621681109312"><span class="hs-identifier hs-var hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109313"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-186"></span><span>                          </span><span id="local-6989586621681109311"><span class="annot"><span class="annottext">occ :: OccName
</span><a href="#local-6989586621681109311"><span class="hs-identifier hs-var hs-var">occ</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109312"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-187"></span><span>                          </span><span id="local-6989586621681109315"><span class="annot"><span class="annottext">rdr_unqual :: RdrName
</span><a href="#local-6989586621681109315"><span class="hs-identifier hs-var hs-var">rdr_unqual</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkRdrUnqual"><span class="hs-identifier hs-var">mkRdrUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109311"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-188"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; Bool
</span><a href="#local-6989586621681109339"><span class="hs-identifier hs-var">correct_name_space</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109311"><span class="hs-identifier hs-var">occ</span></a></span><span>
</span><span id="line-189"></span><span>                    </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109314"><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109314"><span class="hs-identifier hs-var">pair</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [HowInScope]
</span><a href="#local-6989586621681109310"><span class="hs-identifier hs-var">unquals_in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109313"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [(RdrName, HowInScope)]
</span><a href="#local-6989586621681109309"><span class="hs-identifier hs-var">quals_only</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109313"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-190"></span><span>                                </span><span class="hs-special">(</span><span id="local-6989586621681109308"><span class="annot"><span class="annottext">HowInScope
</span><a href="#local-6989586621681109308"><span class="hs-identifier hs-var">how</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[HowInScope]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(RdrName, HowInScope)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109315"><span class="hs-identifier hs-var">rdr_unqual</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HowInScope
</span><a href="#local-6989586621681109308"><span class="hs-identifier hs-var">how</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-191"></span><span>                                </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>    </span><span id="local-6989586621681109307"><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109307"><span class="hs-identifier hs-var">pr</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span class="annot"><span class="annottext">[(RdrName, HowInScope)]
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">(RdrName, HowInScope)
</span><a href="#local-6989586621681109307"><span class="hs-identifier hs-var">pr</span></a></span><span> </span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- See Note [Only-quals]</span><span>
</span><span id="line-192"></span><span>                                </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span>    </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span>              </span><span class="hs-comment">-- Note [Only-quals]</span><span>
</span><span id="line-195"></span><span>              </span><span class="hs-comment">-- The second alternative returns those names with the same</span><span>
</span><span id="line-196"></span><span>              </span><span class="hs-comment">-- OccName as the one we tried, but live in *qualified* imports</span><span>
</span><span id="line-197"></span><span>              </span><span class="hs-comment">-- e.g. if you have:</span><span>
</span><span id="line-198"></span><span>              </span><span class="hs-comment">--</span><span>
</span><span id="line-199"></span><span>              </span><span class="hs-comment">-- &gt; import qualified Data.Map as Map</span><span>
</span><span id="line-200"></span><span>              </span><span class="hs-comment">-- &gt; foo :: Map</span><span>
</span><span id="line-201"></span><span>              </span><span class="hs-comment">--</span><span>
</span><span id="line-202"></span><span>              </span><span class="hs-comment">-- then we suggest @Map.Map@.</span><span>
</span><span id="line-203"></span><span>
</span><span id="line-204"></span><span>    </span><span class="hs-comment">--------------------</span><span>
</span><span id="line-205"></span><span>    </span><span class="annot"><a href="#local-6989586621681109310"><span class="hs-identifier hs-type">unquals_in_scope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-type">HowInScope</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-206"></span><span>    </span><span id="local-6989586621681109310"><span class="annot"><span class="annottext">unquals_in_scope :: GlobalRdrElt -&gt; [HowInScope]
</span><a href="#local-6989586621681109310"><span class="hs-identifier hs-var hs-var">unquals_in_scope</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GRE"><span class="hs-identifier hs-type">GRE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_name :: GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var">gre_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109305"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109305"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_lcl :: GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#gre_lcl"><span class="hs-identifier hs-var">gre_lcl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109303"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109303"><span class="hs-identifier hs-var">lcl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_imp :: GlobalRdrElt -&gt; [ImportSpec]
</span><a href="GHC.Types.Name.Reader.html#gre_imp"><span class="hs-identifier hs-var">gre_imp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109301"><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681109301"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109303"><span class="hs-identifier hs-var">lcl</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HowInScope
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109305"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-208"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; HowInScope
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109300"><span class="hs-identifier hs-var">ispec</span></a></span><span>
</span><span id="line-209"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109299"><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681109299"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681109301"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109300"><span class="annot"><span class="annottext">ispec :: ImpDeclSpec
</span><a href="#local-6989586621681109300"><span class="hs-identifier hs-var hs-var">ispec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImportSpec -&gt; ImpDeclSpec
</span><a href="GHC.Types.Name.Reader.html#is_decl"><span class="hs-identifier hs-var hs-var">is_decl</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681109299"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-210"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#is_qual"><span class="hs-identifier hs-var hs-var">is_qual</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109300"><span class="hs-identifier hs-var">ispec</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span>    </span><span class="hs-comment">--------------------</span><span>
</span><span id="line-214"></span><span>    </span><span class="annot"><a href="#local-6989586621681109309"><span class="hs-identifier hs-type">quals_only</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-type">HowInScope</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-215"></span><span>    </span><span class="hs-comment">-- Ones for which *only* the qualified version is in scope</span><span>
</span><span id="line-216"></span><span>    </span><span id="local-6989586621681109309"><span class="annot"><span class="annottext">quals_only :: GlobalRdrElt -&gt; [(RdrName, HowInScope)]
</span><a href="#local-6989586621681109309"><span class="hs-identifier hs-var hs-var">quals_only</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Name.Reader.html#GRE"><span class="hs-identifier hs-type">GRE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_name :: GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var">gre_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109296"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109296"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_imp :: GlobalRdrElt -&gt; [ImportSpec]
</span><a href="GHC.Types.Name.Reader.html#gre_imp"><span class="hs-identifier hs-var">gre_imp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109295"><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681109295"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-217"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; OccName -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkRdrQual"><span class="hs-identifier hs-var">mkRdrQual</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; ModuleName
</span><a href="GHC.Types.Name.Reader.html#is_as"><span class="hs-identifier hs-var hs-var">is_as</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109293"><span class="hs-identifier hs-var">ispec</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
</span><a href="GHC.Types.Name.html#nameOccName"><span class="hs-identifier hs-var">nameOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109296"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; HowInScope
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109293"><span class="hs-identifier hs-var">ispec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109292"><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681109292"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681109295"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109293"><span class="annot"><span class="annottext">ispec :: ImpDeclSpec
</span><a href="#local-6989586621681109293"><span class="hs-identifier hs-var hs-var">ispec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImportSpec -&gt; ImpDeclSpec
</span><a href="GHC.Types.Name.Reader.html#is_decl"><span class="hs-identifier hs-var hs-var">is_decl</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681109292"><span class="hs-identifier hs-var">i</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#is_qual"><span class="hs-identifier hs-var hs-var">is_qual</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109293"><span class="hs-identifier hs-var">ispec</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span class="hs-comment">-- | Generate helpful suggestions if a qualified name Mod.foo is not in scope.</span><span>
</span><span id="line-221"></span><span class="annot"><a href="GHC.Rename.Unbound.html#importSuggestions"><span class="hs-identifier hs-type">importSuggestions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-type">WhereLooking</span></a></span><span>
</span><span id="line-222"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrEnv"><span class="hs-identifier hs-type">GlobalRdrEnv</span></a></span><span>
</span><span id="line-223"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HomePackageTable"><span class="hs-identifier hs-type">HomePackageTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-224"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ImportAvails"><span class="hs-identifier hs-type">ImportAvails</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-225"></span><span id="importSuggestions"><span class="annot"><span class="annottext">importSuggestions :: WhereLooking
-&gt; GlobalRdrEnv
-&gt; HomePackageTable
-&gt; Module
-&gt; ImportAvails
-&gt; RdrName
-&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#importSuggestions"><span class="hs-identifier hs-var hs-var">importSuggestions</span></a></span></span><span> </span><span id="local-6989586621681109291"><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109291"><span class="hs-identifier hs-var">where_look</span></a></span></span><span> </span><span id="local-6989586621681109290"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109290"><span class="hs-identifier hs-var">global_env</span></a></span></span><span> </span><span id="local-6989586621681109289"><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681109289"><span class="hs-identifier hs-var">hpt</span></a></span></span><span> </span><span id="local-6989586621681109288"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109288"><span class="hs-identifier hs-var">currMod</span></a></span></span><span> </span><span id="local-6989586621681109287"><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681109287"><span class="hs-identifier hs-var">imports</span></a></span></span><span> </span><span id="local-6989586621681109286"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109286"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_LocalOnly"><span class="hs-identifier hs-var">WL_LocalOnly</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109291"><span class="hs-identifier hs-var">where_look</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-227"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RdrName -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isQual"><span class="hs-identifier hs-var">isQual</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109286"><span class="hs-identifier hs-var">rdr_name</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isUnqual"><span class="hs-identifier hs-var">isUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109286"><span class="hs-identifier hs-var">rdr_name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-228"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109282"><span class="hs-identifier hs-var">interesting_imports</span></a></span><span>
</span><span id="line-229"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681109281"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109281"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
</span><a href="#local-6989586621681109280"><span class="hs-identifier hs-var">mod_name</span></a></span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; Bool
</span><a href="#local-6989586621681109279"><span class="hs-identifier hs-var">show_not_imported_line</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109281"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-231"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span>
</span><span id="line-232"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No module named&quot;</span></span><span>
</span><span id="line-233"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109281"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-234"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is imported.&quot;</span></span><span>
</span><span id="line-235"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-236"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109277"><span class="hs-identifier hs-var">is_qualified</span></a></span><span>
</span><span id="line-237"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109276"><span class="hs-identifier hs-var">helpful_imports</span></a></span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621681109275"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109275"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ImportedModsVal
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109282"><span class="hs-identifier hs-var">interesting_imports</span></a></span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span>
</span><span id="line-240"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Module&quot;</span></span><span>
</span><span id="line-241"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109275"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-242"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;does not export&quot;</span></span><span>
</span><span id="line-243"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dot"><span class="hs-identifier hs-var">dot</span></a></span><span>
</span><span id="line-244"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-245"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109277"><span class="hs-identifier hs-var">is_qualified</span></a></span><span>
</span><span id="line-246"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109276"><span class="hs-identifier hs-var">helpful_imports</span></a></span><span>
</span><span id="line-247"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109282"><span class="hs-identifier hs-var">interesting_imports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>  </span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109271"><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681109271"><span class="hs-identifier hs-var">mods</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">((Module, ImportedModsVal) -&gt; Module)
-&gt; [(Module, ImportedModsVal)] -&gt; [Module]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Module, ImportedModsVal) -&gt; Module
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109282"><span class="hs-identifier hs-var">interesting_imports</span></a></span><span>
</span><span id="line-249"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span>
</span><span id="line-250"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Neither&quot;</span></span><span>
</span><span id="line-251"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotedListWithNor"><span class="hs-identifier hs-var">quotedListWithNor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Module -&gt; SDoc) -&gt; [Module] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681109271"><span class="hs-identifier hs-var">mods</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-252"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;exports&quot;</span></span><span>
</span><span id="line-253"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dot"><span class="hs-identifier hs-var">dot</span></a></span><span>
</span><span id="line-254"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-255"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621681109269"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109269"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681109268"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109268"><span class="hs-identifier hs-var">imv</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109267"><span class="hs-identifier hs-var">helpful_imports_non_hiding</span></a></span><span>
</span><span id="line-256"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span>
</span><span id="line-257"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you want to add&quot;</span></span><span>
</span><span id="line-258"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;to the import list&quot;</span></span><span>
</span><span id="line-260"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in the import of&quot;</span></span><span>
</span><span id="line-261"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109269"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-262"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; SrcSpan
</span><a href="GHC.Driver.Types.html#imv_span"><span class="hs-identifier hs-var hs-var">imv_span</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109268"><span class="hs-identifier hs-var">imv</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dot"><span class="hs-identifier hs-var">dot</span></a></span><span>
</span><span id="line-263"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109267"><span class="hs-identifier hs-var">helpful_imports_non_hiding</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span>
</span><span id="line-266"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you want to add&quot;</span></span><span>
</span><span id="line-267"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;to one of these import lists:&quot;</span></span><span>
</span><span id="line-269"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-270"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-271"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-272"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109263"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; SrcSpan
</span><a href="GHC.Driver.Types.html#imv_span"><span class="hs-identifier hs-var hs-var">imv_span</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109262"><span class="hs-identifier hs-var">imv</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-273"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109263"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109263"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681109262"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109262"><span class="hs-identifier hs-var">imv</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109267"><span class="hs-identifier hs-var">helpful_imports_non_hiding</span></a></span><span>
</span><span id="line-274"></span><span>        </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-275"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span id="local-6989586621681109261"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109261"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681109260"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109260"><span class="hs-identifier hs-var">imv</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109259"><span class="hs-identifier hs-var">helpful_imports_hiding</span></a></span><span>
</span><span id="line-276"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span>
</span><span id="line-277"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you want to remove&quot;</span></span><span>
</span><span id="line-278"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-279"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;from the explicit hiding list&quot;</span></span><span>
</span><span id="line-280"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in the import of&quot;</span></span><span>
</span><span id="line-281"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109261"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; SrcSpan
</span><a href="GHC.Driver.Types.html#imv_span"><span class="hs-identifier hs-var hs-var">imv_span</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109260"><span class="hs-identifier hs-var">imv</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#dot"><span class="hs-identifier hs-var">dot</span></a></span><span>
</span><span id="line-283"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-284"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109259"><span class="hs-identifier hs-var">helpful_imports_hiding</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#fsep"><span class="hs-identifier hs-var">fsep</span></a></span><span>
</span><span id="line-286"></span><span>      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you want to remove&quot;</span></span><span>
</span><span id="line-287"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OccName -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;from the hiding clauses&quot;</span></span><span>
</span><span id="line-289"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;in one of these imports:&quot;</span></span><span>
</span><span id="line-290"></span><span>      </span><span class="hs-special">]</span><span>
</span><span id="line-291"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-292"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-293"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109258"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; SrcSpan
</span><a href="GHC.Driver.Types.html#imv_span"><span class="hs-identifier hs-var hs-var">imv_span</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109257"><span class="hs-identifier hs-var">imv</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-294"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109258"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109258"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681109257"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109257"><span class="hs-identifier hs-var">imv</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109259"><span class="hs-identifier hs-var">helpful_imports_hiding</span></a></span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-297"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-298"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-299"></span><span>  </span><span id="local-6989586621681109277"><span class="annot"><span class="annottext">is_qualified :: Bool
</span><a href="#local-6989586621681109277"><span class="hs-identifier hs-var hs-var">is_qualified</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isQual"><span class="hs-identifier hs-var">isQual</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109286"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-300"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681109280"><span class="annot"><span class="annottext">Maybe ModuleName
</span><a href="#local-6989586621681109280"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109274"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109286"><span class="hs-identifier hs-var">rdr_name</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-301"></span><span>    </span><span class="annot"><a href="GHC.Types.Name.Reader.html#Unqual"><span class="hs-identifier hs-type">Unqual</span></a></span><span> </span><span id="local-6989586621681109253"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109253"><span class="hs-identifier hs-var">occ_name</span></a></span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe ModuleName
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109253"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>    </span><span class="annot"><a href="GHC.Types.Name.Reader.html#Qual"><span class="hs-identifier hs-type">Qual</span></a></span><span> </span><span id="local-6989586621681109251"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109251"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span> </span><span id="local-6989586621681109250"><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109250"><span class="hs-identifier hs-var">occ_name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleName -&gt; Maybe ModuleName
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109251"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109250"><span class="hs-identifier hs-var">occ_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>    </span><span class="annot"><span class="annottext">RdrName
</span><span class="hs-identifier">_</span></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; (Maybe ModuleName, OccName)
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;importSuggestions: dead code&quot;</span></span><span>
</span><span id="line-304"></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span>  </span><span class="hs-comment">-- What import statements provide &quot;Mod&quot; at all</span><span>
</span><span id="line-307"></span><span>  </span><span class="hs-comment">-- or, if this is an unqualified name, are not qualified imports</span><span>
</span><span id="line-308"></span><span>  </span><span id="local-6989586621681109282"><span class="annot"><span class="annottext">interesting_imports :: [(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109282"><span class="hs-identifier hs-var hs-var">interesting_imports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109246"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109245"><span class="hs-identifier hs-var">imp</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109246"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109246"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109244"><span class="annot"><span class="annottext">[ImportedBy]
</span><a href="#local-6989586621681109244"><span class="hs-identifier hs-var">mod_imports</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleEnv [ImportedBy] -&gt; [(Module, [ImportedBy])]
forall a. ModuleEnv a -&gt; [(Module, a)]
</span><a href="GHC.Unit.Module.Env.html#moduleEnvToList"><span class="hs-identifier hs-var">moduleEnvToList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportAvails -&gt; ModuleEnv [ImportedBy]
</span><a href="GHC.Tc.Types.html#imp_mods"><span class="hs-identifier hs-var hs-var">imp_mods</span></a></span><span> </span><span class="annot"><span class="annottext">ImportAvails
</span><a href="#local-6989586621681109287"><span class="hs-identifier hs-var">imports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-310"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681109245"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109245"><span class="hs-identifier hs-var">imp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Maybe ImportedModsVal -&gt; [Maybe ImportedModsVal]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe ImportedModsVal -&gt; [Maybe ImportedModsVal])
-&gt; Maybe ImportedModsVal -&gt; [Maybe ImportedModsVal]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[ImportedModsVal] -&gt; Maybe ImportedModsVal
</span><a href="#local-6989586621681109241"><span class="hs-identifier hs-var">pick</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ImportedBy] -&gt; [ImportedModsVal]
</span><a href="GHC.Driver.Types.html#importedByUser"><span class="hs-identifier hs-var">importedByUser</span></a></span><span> </span><span class="annot"><span class="annottext">[ImportedBy]
</span><a href="#local-6989586621681109244"><span class="hs-identifier hs-var">mod_imports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>    </span><span class="hs-special">]</span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span>  </span><span class="hs-comment">-- We want to keep only one for each original module; preferably one with an</span><span>
</span><span id="line-314"></span><span>  </span><span class="hs-comment">-- explicit import list (for no particularly good reason)</span><span>
</span><span id="line-315"></span><span>  </span><span class="annot"><a href="#local-6989586621681109241"><span class="hs-identifier hs-type">pick</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Driver.Types.html#ImportedModsVal"><span class="hs-identifier hs-type">ImportedModsVal</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ImportedModsVal"><span class="hs-identifier hs-type">ImportedModsVal</span></a></span><span>
</span><span id="line-316"></span><span>  </span><span id="local-6989586621681109241"><span class="annot"><span class="annottext">pick :: [ImportedModsVal] -&gt; Maybe ImportedModsVal
</span><a href="#local-6989586621681109241"><span class="hs-identifier hs-var hs-var">pick</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ImportedModsVal] -&gt; Maybe ImportedModsVal
forall a. [a] -&gt; Maybe a
</span><a href="../../base/src/Data.Maybe.html#listToMaybe"><span class="hs-identifier hs-var">listToMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">([ImportedModsVal] -&gt; Maybe ImportedModsVal)
-&gt; ([ImportedModsVal] -&gt; [ImportedModsVal])
-&gt; [ImportedModsVal]
-&gt; Maybe ImportedModsVal
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ImportedModsVal -&gt; ImportedModsVal -&gt; Ordering)
-&gt; [ImportedModsVal] -&gt; [ImportedModsVal]
forall a. (a -&gt; a -&gt; Ordering) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#sortBy"><span class="hs-identifier hs-var">sortBy</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal -&gt; ImportedModsVal -&gt; Ordering
</span><a href="#local-6989586621681109236"><span class="hs-identifier hs-var">cmp</span></a></span><span> </span><span class="annot"><span class="annottext">([ImportedModsVal] -&gt; [ImportedModsVal])
-&gt; ([ImportedModsVal] -&gt; [ImportedModsVal])
-&gt; [ImportedModsVal]
-&gt; [ImportedModsVal]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(ImportedModsVal -&gt; Bool) -&gt; [ImportedModsVal] -&gt; [ImportedModsVal]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal -&gt; Bool
</span><a href="#local-6989586621681109235"><span class="hs-identifier hs-var">select</span></a></span><span>
</span><span id="line-317"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681109235"><span class="annot"><span class="annottext">select :: ImportedModsVal -&gt; Bool
</span><a href="#local-6989586621681109235"><span class="hs-identifier hs-var hs-var">select</span></a></span></span><span> </span><span id="local-6989586621681109233"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109233"><span class="hs-identifier hs-var">imv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe ModuleName
</span><a href="#local-6989586621681109280"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681109232"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109232"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ImportedModsVal -&gt; ModuleName
</span><a href="GHC.Driver.Types.html#imv_name"><span class="hs-identifier hs-var hs-var">imv_name</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109233"><span class="hs-identifier hs-var">imv</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; ModuleName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109232"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-318"></span><span>                                        </span><span class="annot"><span class="annottext">Maybe ModuleName
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; Bool
</span><a href="GHC.Driver.Types.html#imv_qualified"><span class="hs-identifier hs-var hs-var">imv_qualified</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109233"><span class="hs-identifier hs-var">imv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span>          </span><span id="local-6989586621681109236"><span class="annot"><span class="annottext">cmp :: ImportedModsVal -&gt; ImportedModsVal -&gt; Ordering
</span><a href="#local-6989586621681109236"><span class="hs-identifier hs-var hs-var">cmp</span></a></span></span><span> </span><span id="local-6989586621681109227"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109227"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681109226"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109226"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-320"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Ordering
forall a. Ord a =&gt; a -&gt; a -&gt; Ordering
</span><span class="hs-identifier hs-var">compare</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool -&gt; Ordering)
-&gt; (ImportedModsVal -&gt; Bool)
-&gt; ImportedModsVal
-&gt; ImportedModsVal
-&gt; Ordering
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal -&gt; Bool
</span><a href="GHC.Driver.Types.html#imv_is_hiding"><span class="hs-identifier hs-var hs-var">imv_is_hiding</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109227"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109226"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-321"></span><span>              </span><span class="annot"><span class="annottext">Ordering -&gt; Ordering -&gt; Ordering
</span><a href="GHC.Utils.Misc.html#thenCmp"><span class="hs-operator hs-var">`thenCmp`</span></a></span><span>
</span><span id="line-322"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; SrcSpan -&gt; Ordering
</span><a href="GHC.Types.SrcLoc.html#leftmost_smallest"><span class="hs-identifier hs-var">SrcLoc.leftmost_smallest</span></a></span><span> </span><span class="annot"><span class="annottext">(SrcSpan -&gt; SrcSpan -&gt; Ordering)
-&gt; (ImportedModsVal -&gt; SrcSpan)
-&gt; ImportedModsVal
-&gt; ImportedModsVal
-&gt; Ordering
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal -&gt; SrcSpan
</span><a href="GHC.Driver.Types.html#imv_span"><span class="hs-identifier hs-var hs-var">imv_span</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109227"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109226"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span>  </span><span class="hs-comment">-- Which of these would export a 'foo'</span><span>
</span><span id="line-325"></span><span>  </span><span class="hs-comment">-- (all of these are restricted imports, because if they were not, we</span><span>
</span><span id="line-326"></span><span>  </span><span class="hs-comment">-- wouldn't have an out-of-scope error in the first place)</span><span>
</span><span id="line-327"></span><span>  </span><span id="local-6989586621681109276"><span class="annot"><span class="annottext">helpful_imports :: [(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109276"><span class="hs-identifier hs-var hs-var">helpful_imports</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Module, ImportedModsVal) -&gt; Bool)
-&gt; [(Module, ImportedModsVal)] -&gt; [(Module, ImportedModsVal)]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">(Module, ImportedModsVal) -&gt; Bool
forall {a}. (a, ImportedModsVal) -&gt; Bool
</span><a href="#local-6989586621681109221"><span class="hs-identifier hs-var">helpful</span></a></span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109282"><span class="hs-identifier hs-var">interesting_imports</span></a></span><span>
</span><span id="line-328"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681109221"><span class="annot"><span class="annottext">helpful :: (a, ImportedModsVal) -&gt; Bool
</span><a href="#local-6989586621681109221"><span class="hs-identifier hs-var hs-var">helpful</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span id="local-6989586621681109219"><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109219"><span class="hs-identifier hs-var">imv</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool)
-&gt; ([GlobalRdrElt] -&gt; Bool) -&gt; [GlobalRdrElt] -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalRdrElt] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([GlobalRdrElt] -&gt; Bool) -&gt; [GlobalRdrElt] -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; OccName -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#lookupGlobalRdrEnv"><span class="hs-identifier hs-var">lookupGlobalRdrEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#imv_all_exports"><span class="hs-identifier hs-var hs-var">imv_all_exports</span></a></span><span> </span><span class="annot"><span class="annottext">ImportedModsVal
</span><a href="#local-6989586621681109219"><span class="hs-identifier hs-var">imv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681109274"><span class="hs-identifier hs-var">occ_name</span></a></span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span>  </span><span class="hs-comment">-- Which of these do that because of an explicit hiding list resp. an</span><span>
</span><span id="line-332"></span><span>  </span><span class="hs-comment">-- explicit import list</span><span>
</span><span id="line-333"></span><span>  </span><span class="hs-special">(</span><span id="local-6989586621681109259"><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109259"><span class="hs-identifier hs-var">helpful_imports_hiding</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681109267"><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109267"><span class="hs-identifier hs-var">helpful_imports_non_hiding</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Module, ImportedModsVal) -&gt; Bool)
-&gt; [(Module, ImportedModsVal)]
-&gt; ([(Module, ImportedModsVal)], [(Module, ImportedModsVal)])
forall a. (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/Data.OldList.html#partition"><span class="hs-identifier hs-var">partition</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImportedModsVal -&gt; Bool
</span><a href="GHC.Driver.Types.html#imv_is_hiding"><span class="hs-identifier hs-var hs-var">imv_is_hiding</span></a></span><span> </span><span class="annot"><span class="annottext">(ImportedModsVal -&gt; Bool)
-&gt; ((Module, ImportedModsVal) -&gt; ImportedModsVal)
-&gt; (Module, ImportedModsVal)
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Module, ImportedModsVal) -&gt; ImportedModsVal
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[(Module, ImportedModsVal)]
</span><a href="#local-6989586621681109276"><span class="hs-identifier hs-var">helpful_imports</span></a></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span>  </span><span class="hs-comment">-- See note [When to show/hide the module-not-imported line]</span><span>
</span><span id="line-337"></span><span>  </span><span class="annot"><a href="#local-6989586621681109279"><span class="hs-identifier hs-type">show_not_imported_line</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                    </span><span class="hs-comment">-- #15611</span><span>
</span><span id="line-338"></span><span>  </span><span id="local-6989586621681109279"><span class="annot"><span class="annottext">show_not_imported_line :: ModuleName -&gt; Bool
</span><a href="#local-6989586621681109279"><span class="hs-identifier hs-var hs-var">show_not_imported_line</span></a></span></span><span> </span><span id="local-6989586621681109215"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109215"><span class="hs-identifier hs-var">modnam</span></a></span></span><span>
</span><span id="line-339"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109215"><span class="hs-identifier hs-var">modnam</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [ModuleName] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">[ModuleName]
</span><a href="#local-6989586621681109213"><span class="hs-identifier hs-var">globMods</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>    </span><span class="hs-comment">-- #14225     -- 1</span><span>
</span><span id="line-340"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109288"><span class="hs-identifier hs-var">currMod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; ModuleName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109215"><span class="hs-identifier hs-var">modnam</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>                  </span><span class="hs-comment">-- 2.1</span><span>
</span><span id="line-341"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; [Unique] -&gt; Bool
forall {a}. Uniquable a =&gt; a -&gt; [Unique] -&gt; Bool
</span><a href="#local-6989586621681109211"><span class="hs-identifier hs-var">is_last_loaded_mod</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109215"><span class="hs-identifier hs-var">modnam</span></a></span><span> </span><span class="annot"><span class="annottext">[Unique]
</span><a href="#local-6989586621681109210"><span class="hs-identifier hs-var">hpt_uniques</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>                  </span><span class="hs-comment">-- 2.2</span><span>
</span><span id="line-342"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-343"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-344"></span><span>      </span><span id="local-6989586621681109210"><span class="annot"><span class="annottext">hpt_uniques :: [Unique]
</span><a href="#local-6989586621681109210"><span class="hs-identifier hs-var hs-var">hpt_uniques</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Unique, HomeModInfo) -&gt; Unique)
-&gt; [(Unique, HomeModInfo)] -&gt; [Unique]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Unique, HomeModInfo) -&gt; Unique
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HomePackageTable -&gt; [(Unique, HomeModInfo)]
forall key elt. UniqDFM key elt -&gt; [(Unique, elt)]
</span><a href="GHC.Types.Unique.DFM.html#udfmToList"><span class="hs-identifier hs-var">udfmToList</span></a></span><span> </span><span class="annot"><span class="annottext">HomePackageTable
</span><a href="#local-6989586621681109289"><span class="hs-identifier hs-var">hpt</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span>      </span><span id="local-6989586621681109211"><span class="annot"><span class="annottext">is_last_loaded_mod :: a -&gt; [Unique] -&gt; Bool
</span><a href="#local-6989586621681109211"><span class="hs-identifier hs-var hs-var">is_last_loaded_mod</span></a></span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-346"></span><span>      </span><span class="annot"><a href="#local-6989586621681109211"><span class="hs-identifier hs-var">is_last_loaded_mod</span></a></span><span> </span><span id="local-6989586621681109205"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681109205"><span class="hs-identifier hs-var">modnam</span></a></span></span><span> </span><span id="local-6989586621681109204"><span class="annot"><span class="annottext">[Unique]
</span><a href="#local-6989586621681109204"><span class="hs-identifier hs-var">uniqs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Unique] -&gt; Unique
forall a. [a] -&gt; a
</span><a href="../../base/src/GHC.List.html#last"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="annot"><span class="annottext">[Unique]
</span><a href="#local-6989586621681109204"><span class="hs-identifier hs-var">uniqs</span></a></span><span> </span><span class="annot"><span class="annottext">Unique -&gt; Unique -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a -&gt; Unique
forall a. Uniquable a =&gt; a -&gt; Unique
</span><a href="GHC.Types.Unique.html#getUnique"><span class="hs-identifier hs-var">getUnique</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681109205"><span class="hs-identifier hs-var">modnam</span></a></span><span>
</span><span id="line-347"></span><span>      </span><span id="local-6989586621681109213"><span class="annot"><span class="annottext">globMods :: [ModuleName]
</span><a href="#local-6989586621681109213"><span class="hs-identifier hs-var hs-var">globMods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ModuleName] -&gt; [ModuleName]
forall a. Eq a =&gt; [a] -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#nub"><span class="hs-identifier hs-var">nub</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109200"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-348"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109199"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109199"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681109290"><span class="hs-identifier hs-var">global_env</span></a></span><span>
</span><span id="line-349"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">WhereLooking -&gt; GlobalRdrElt -&gt; Bool
</span><a href="GHC.Rename.Unbound.html#isGreOk"><span class="hs-identifier hs-var">isGreOk</span></a></span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109291"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109199"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-350"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681109200"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621681109200"><span class="hs-identifier hs-var">mod</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">HowInScope
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; [(ModuleName, HowInScope)]
</span><a href="GHC.Rename.Unbound.html#qualsInScope"><span class="hs-identifier hs-var">qualsInScope</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681109199"><span class="hs-identifier hs-var">gre</span></a></span><span>
</span><span id="line-351"></span><span>                     </span><span class="hs-special">]</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span class="annot"><a href="GHC.Rename.Unbound.html#extensionSuggestions"><span class="hs-identifier hs-type">extensionSuggestions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#RdrName"><span class="hs-identifier hs-type">RdrName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-354"></span><span id="extensionSuggestions"><span class="annot"><span class="annottext">extensionSuggestions :: RdrName -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#extensionSuggestions"><span class="hs-identifier hs-var hs-var">extensionSuggestions</span></a></span></span><span> </span><span id="local-6989586621681109198"><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109198"><span class="hs-identifier hs-var">rdrName</span></a></span></span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109198"><span class="hs-identifier hs-var">rdrName</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RdrName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; FastString -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkUnqual"><span class="hs-identifier hs-var">mkUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;mdo&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span>
</span><span id="line-356"></span><span>    </span><span class="annot"><span class="annottext">RdrName
</span><a href="#local-6989586621681109198"><span class="hs-identifier hs-var">rdrName</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RdrName -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">NameSpace -&gt; FastString -&gt; RdrName
</span><a href="GHC.Types.Name.Reader.html#mkUnqual"><span class="hs-identifier hs-var">mkUnqual</span></a></span><span> </span><span class="annot"><span class="annottext">NameSpace
</span><a href="GHC.Types.Name.Occurrence.html#varName"><span class="hs-identifier hs-var">varName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rec&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you meant to use RecursiveDo&quot;</span></span><span>
</span><span id="line-358"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">Outputable.empty</span></a></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="annot"><a href="GHC.Rename.Unbound.html#qualsInScope"><span class="hs-identifier hs-type">qualsInScope</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Unit.Module.Name.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#HowInScope"><span class="hs-identifier hs-type">HowInScope</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-361"></span><span class="hs-comment">-- Ones for which the qualified version is in scope</span><span>
</span><span id="line-362"></span><span id="qualsInScope"><span class="annot"><span class="annottext">qualsInScope :: GlobalRdrElt -&gt; [(ModuleName, HowInScope)]
</span><a href="GHC.Rename.Unbound.html#qualsInScope"><span class="hs-identifier hs-var hs-var">qualsInScope</span></a></span></span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GRE"><span class="hs-identifier hs-type">GRE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">gre_name :: GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var">gre_name</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109194"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109194"><span class="hs-identifier hs-var">n</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_lcl :: GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#gre_lcl"><span class="hs-identifier hs-var">gre_lcl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109193"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109193"><span class="hs-identifier hs-var">lcl</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">gre_imp :: GlobalRdrElt -&gt; [ImportSpec]
</span><a href="GHC.Types.Name.Reader.html#gre_imp"><span class="hs-identifier hs-var">gre_imp</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681109192"><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681109192"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-363"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681109193"><span class="hs-identifier hs-var">lcl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Maybe Module
</span><a href="GHC.Types.Name.html#nameModule_maybe"><span class="hs-identifier hs-var">nameModule_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109194"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-364"></span><span>                </span><span class="annot"><span class="annottext">Maybe Module
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-365"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681109190"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109190"><span class="hs-identifier hs-var">m</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681109190"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HowInScope
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#nameSrcSpan"><span class="hs-identifier hs-var">nameSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109194"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-366"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; ModuleName
</span><a href="GHC.Types.Name.Reader.html#is_as"><span class="hs-identifier hs-var hs-var">is_as</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109189"><span class="hs-identifier hs-var">ispec</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec -&gt; HowInScope
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">ImpDeclSpec
</span><a href="#local-6989586621681109189"><span class="hs-identifier hs-var">ispec</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681109188"><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681109188"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ImportSpec]
</span><a href="#local-6989586621681109192"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681109189"><span class="annot"><span class="annottext">ispec :: ImpDeclSpec
</span><a href="#local-6989586621681109189"><span class="hs-identifier hs-var hs-var">ispec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ImportSpec -&gt; ImpDeclSpec
</span><a href="GHC.Types.Name.Reader.html#is_decl"><span class="hs-identifier hs-var hs-var">is_decl</span></a></span><span> </span><span class="annot"><span class="annottext">ImportSpec
</span><a href="#local-6989586621681109188"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span class="annot"><a href="GHC.Rename.Unbound.html#isGreOk"><span class="hs-identifier hs-type">isGreOk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html#WhereLooking"><span class="hs-identifier hs-type">WhereLooking</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html#GlobalRdrElt"><span class="hs-identifier hs-type">GlobalRdrElt</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-370"></span><span id="isGreOk"><span class="annot"><span class="annottext">isGreOk :: WhereLooking -&gt; GlobalRdrElt -&gt; Bool
</span><a href="GHC.Rename.Unbound.html#isGreOk"><span class="hs-identifier hs-var hs-var">isGreOk</span></a></span></span><span> </span><span id="local-6989586621681109187"><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109187"><span class="hs-identifier hs-var">where_look</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="#local-6989586621681109187"><span class="hs-identifier hs-var">where_look</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-371"></span><span>                         </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_LocalTop"><span class="hs-identifier hs-var">WL_LocalTop</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isLocalGRE"><span class="hs-identifier hs-var">isLocalGRE</span></a></span><span>
</span><span id="line-372"></span><span>                         </span><span class="annot"><span class="annottext">WhereLooking
</span><a href="GHC.Rename.Unbound.html#WL_LocalOnly"><span class="hs-identifier hs-var">WL_LocalOnly</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; GlobalRdrElt -&gt; Bool
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-373"></span><span>                         </span><span class="annot"><span class="annottext">WhereLooking
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; GlobalRdrElt -&gt; Bool
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span class="hs-comment">{- Note [When to show/hide the module-not-imported line]           -- #15611
For the error message:
    Not in scope X.Y
    Module X does not export Y
    No module named &#8216;X&#8217; is imported:
there are 2 cases, where we hide the last &quot;no module is imported&quot; line:
1. If the module X has been imported.
2. If the module X is the current module. There are 2 subcases:
   2.1 If the unknown module name is in a input source file,
       then we can use the getModule function to get the current module name.
       (See test T15611a)
   2.2 If the unknown module name has been entered by the user in GHCi,
       then the getModule function returns something like &quot;interactive:Ghci1&quot;,
       and we have to check the current module in the last added entry of
       the HomePackageTable. (See test T15611b)
-}</span><span>
</span><span id="line-391"></span><span>
</span><span id="line-392"></span><span class="annot"><a href="GHC.Rename.Unbound.html#exactNameErr"><span class="hs-identifier hs-type">exactNameErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-393"></span><span id="exactNameErr"><span class="annot"><span class="annottext">exactNameErr :: Name -&gt; SDoc
</span><a href="GHC.Rename.Unbound.html#exactNameErr"><span class="hs-identifier hs-var hs-var">exactNameErr</span></a></span></span><span> </span><span id="local-6989586621681109184"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109184"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-394"></span><span>  </span><span class="annot"><span class="annottext">SDoc -&gt; Int -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;The exact Name&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681109184"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">PtrString -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ptext"><span class="hs-identifier hs-var">ptext</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PtrString
</span><a href="GHC.Data.FastString.html#sLit"><span class="hs-identifier hs-var">sLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not in scope&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-395"></span><span>    </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Probable cause: you used a unique Template Haskell name (NameU), &quot;</span></span><span>
</span><span id="line-396"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;perhaps via newName, but did not bind it&quot;</span></span><span>
</span><span id="line-397"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;If that's it, then -ddump-splices might be useful&quot;</span></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-398"></span></pre></body></html>